/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.onlineresortreservation.connection;
import java.sql.*;
import java.util.*;

/**
 *
 * @author 
 */
public class Dbcon {
        private String URL;
	private String Driver;
	private Connection con; 
        
        public Dbcon() {
        
        try
			{
				ResourceBundle rb= ResourceBundle.getBundle("org.onlineresortreservation.config");
				Driver= rb.getString("DBDriver");
				URL= rb.getString("DBURL");
                                
                        }
                        
        catch(Exception e)
			{
				System.out.println(e.getMessage());
			}
                            }
        
        
        public Connection open() throws ClassNotFoundException, SQLException {
			Class.forName("com.mysql.jdbc.Driver");
		 	con= DriverManager.getConnection("jdbc:mysql://localhost:3306/resortreservation?user=root&password=");
                        return con;
		
		
	}

	public void conclose() throws SQLException {
			con.close();
			}
}
